import { createSSRApp } from 'vue';
import {} from 'pinia';
import App from './App.vue';
import { handleError } from '@/utils/error-handler';

export function createApp() {
  const app = createSSRApp(App);
  const pinia = createPinia();
  app.use(pinia);

  // 全局错误处理
  app.config.errorHandler = (err, vm, info) => {
    handleError(err);
  };

  return {
    app,
  };
}
